<body>
    <form id="my-form">
        <div id="tools" class="datagrid-toolbar">
            <input type="hidden" name="objectId" id="objectId">
            <input type="hidden" name="type" id="type" value="5">
            <a id="subBtn" name="subOk" class="easyui-linkbutton l-btn l-btn-plain" iconcls="icon-save"
                plain="true"><span class="l-btn-left"><span
                        class="l-btn-text icon-save l-btn-icon-left">保存</span></span></a>
            <a id="closeBtn" name="backOk" class="easyui-linkbutton l-btn l-btn-plain" iconcls="icon-close"
                plain="true"><span class="l-btn-left"><span
                        class="l-btn-text icon-close l-btn-icon-left">关闭</span></span></a>
        </div>
        <p id="errorMsg" style="color:red;margin-top:5px;"></p>
        <table class="formTable">
            <tbody>
                <tr>
                    <td class="tdc1" style="width:150px;">
                        申请人：
                    </td>
                    <td>
                        <input type="text" name="applyUserName" id="applyUserName" data-options="required:true"
                            class="easyui-validatebox texfind validatebox-text" readonly="">
                        <input type="hidden" name="applyUserId" id="applyUserId">
                        <a class="easyui-linkbutton l-btn l-btn-plain" iconcls="icon-undo" plain="true"
                            onclick="clearCheck('applyUserName,applyUserId');" id=""><span class="l-btn-left"><span
                                    class="l-btn-text icon-undo l-btn-icon-left">清除</span></span></a>
                    </td>
                </tr>
                <tr>
                    <td class="tdc1">
                        领队/项目经理：
                    </td>
                    <td>
                        <!-- <input type="text" name="leaderName" id="leaderName" class="easyui-validatebox texfind" readonly/>
						<input type="hidden" name="leaderId" id="leaderId"/>
						<a class="easyui-linkbutton" id="clear3" iconCls="icon-undo" plain="true" onclick="clearCheck('leaderName,leaderId');">清除</a> -->
                        <input type="text" name="approvalNames" id="approvalNames"
                            class="easyui-validatebox texfind validatebox-text" readonly="">
                        <input type="hidden" name="approvalIds" id="approvalIds">
                        <a class="easyui-linkbutton l-btn l-btn-plain" iconcls="icon-undo" plain="true"
                            onclick="clearCheck('approvalNames,approvalIds');" id=""><span class="l-btn-left"><span
                                    class="l-btn-text icon-undo l-btn-icon-left">清除</span></span></a>
                    </td>
                </tr>

                <tr>
                    <td class="tdc1">
                        主管副总裁：
                    </td>
                    <td>
                        <input type="text" name="managername" id="managername"
                            class="easyui-validatebox texfind validatebox-text" readonly="">
                        <input type="hidden" name="managerid" id="managerid">
                        <a class="easyui-linkbutton l-btn l-btn-plain" id="clear3" iconcls="icon-undo" plain="true"
                            onclick="clearCheck('managername,managerid');"><span class="l-btn-left"><span
                                    class="l-btn-text icon-undo l-btn-icon-left">清除</span></span></a>
                    </td>
                </tr>


                <tr>
                    <td class="tdc1">
                        总裁：
                    </td>
                    <td>
                        <input type="text" name="managerDname" id="managerDname"
                            class="easyui-validatebox texfind validatebox-text" readonly="">
                        <input type="hidden" name="managerDid" id="managerDid">
                        <a class="easyui-linkbutton l-btn l-btn-plain" id="clear3" iconcls="icon-undo" plain="true"
                            onclick="clearCheck('managerDname,managerDid');"><span class="l-btn-left"><span
                                    class="l-btn-text icon-undo l-btn-icon-left">清除</span></span></a>
                    </td>
                </tr>

                <tr>
                    <td class="tdc1">
                        董事长：
                    </td>
                    <td>
                        <input type="text" name="presidentname" id="presidentname"
                            class="easyui-validatebox texfind validatebox-text" readonly="">
                        <input type="hidden" name="presidentid" id="presidentid">
                        <a class="easyui-linkbutton l-btn l-btn-plain" id="clear3" iconcls="icon-undo" plain="true"
                            onclick="clearCheck('presidentname,presidentid');"><span class="l-btn-left"><span
                                    class="l-btn-text icon-undo l-btn-icon-left">清除</span></span></a>
                    </td>
                </tr>

                <tr>
                    <td class="tdc1">
                        政委书记：
                    </td>
                    <td>
                        <input type="text" name="commisorName" id="commisorName"
                            class="easyui-validatebox texfind validatebox-text" readonly="">
                        <input type="hidden" name="commisorId" id="commisorId">
                        <a class="easyui-linkbutton l-btn l-btn-plain" id="clear3" iconcls="icon-undo" plain="true"
                            onclick="clearCheck('commisorName,commisorId');"><span class="l-btn-left"><span
                                    class="l-btn-text icon-undo l-btn-icon-left">清除</span></span></a>
                    </td>
                </tr>
                <tr>
                    <td class="tdc1">
                        项目名称：
                    </td>
                    <td>
                        <input type="text" name="projectName" id="projectName"
                            class="easyui-validatebox validatebox-text">
                    </td>
                </tr>

                <tr>
                    <td class="tdc1">
                        起止时间：
                    </td>
                    <td>
                        <input type="text" name="starDate" id="starDate" readonly="readonly"
                            class="easyui-validatebox Wdate validatebox-text" style="width: 150px"
                            onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})">-<input type="text" name="enDate" id="enDate"
                            style="width: 150px" readonly="readonly" class="easyui-validatebox Wdate validatebox-text"
                            onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})">
                    </td>
                </tr>

                <tr>
                    <td class="tdc1">
                        天数：
                    </td>
                    <td>
                        <input type="text" name="days" id="days" class="easyui-validatebox validatebox-text">
                    </td>
                </tr>

                <tr>
                    <td class="tdc1">
                        途经国家及城市：
                    </td>
                    <td>
                        1、<input type="text" name="cityName1" id="cityName1"
                            class="easyui-validatebox validatebox-text"><br>
                        2、<input type="text" name="cityName2" id="cityName2"
                            class="easyui-validatebox validatebox-text"><br>
                        3、<input type="text" name="cityName3" id="cityName3"
                            class="easyui-validatebox validatebox-text"><br>
                        4、<input type="text" name="cityName4" id="cityName4"
                            class="easyui-validatebox validatebox-text"><br>
                        5、<input type="text" name="cityName5" id="cityName5"
                            class="easyui-validatebox validatebox-text">
                    </td>
                </tr>

                <tr>
                    <td class="tdc1">
                        出访事由：
                    </td>
                    <td>
                        <textarea name="visitingReson" id="visitingReson" style="width:70%;height:70px"></textarea>
                    </td>
                </tr>

                <tr>
                    <td class="tdc1">
                        经费支出单位：
                    </td>
                    <td>
                        <input type="text" name="expendUnit" id="expendUnit"
                            class="easyui-validatebox validatebox-text">
                    </td>
                </tr>

            </tbody>
        </table>
    </form>
    <br>
    <div id="tools" class="datagrid-toolbar">
        <a onclick="javascript:$.messager.alert('提示','请先保存后再录入参加人员信息');" contextmenu="true:add();"
            class="easyui-linkbutton l-btn l-btn-plain" iconcls="icon-add" plain="true" id=""><span
                class="l-btn-left"><span class="l-btn-text icon-add l-btn-icon-left">新增参加人员信息</span></span></a>
    </div>
    <div class="panel datagrid" style="width: auto;">
        <div class="datagrid-wrap panel-body panel-body-noheader" title="" style="width: 1279px; height: auto;">
            <div class="datagrid-view" style="width: 1279px; height: 25px;">
                <style type="text/css">
                    div.datagrid-cell-c1-deptNames {
                        width: 192px;
                    }

                    div.datagrid-cell-c1-dicNames {
                        width: 142px;
                    }

                    div.datagrid-cell-c1-reasons {
                        width: 292px;
                    }

                    div.datagrid-cell-c1-reasons {
                        width: 292px;
                    }
                </style>
                <div class="datagrid-view1" style="width: 41px;">
                    <div class="datagrid-header" style="width: 41px; height: 24px;">
                        <div class="datagrid-header-inner" style="display: block;">
                            <table class="datagrid-htable" border="0" cellspacing="0" cellpadding="0"
                                style="height: 25px;">
                                <tbody>
                                    <tr class="datagrid-header-row">
                                        <td rowspan="0">
                                            <div class="datagrid-header-rownumber"></div>
                                        </td>
                                    </tr>
                                </tbody>
                            </table>
                        </div>
                    </div>
                    <div class="datagrid-body" style="width: 41px; height: 0px;">
                        <div class="datagrid-body-inner">
                            <table class="datagrid-btable" cellspacing="0" cellpadding="0" border="0">
                                <tbody></tbody>
                            </table>
                        </div>
                    </div>
                    <div class="datagrid-footer" style="width: 41px;">
                        <div class="datagrid-footer-inner" style="display: none;"></div>
                    </div>
                </div>
                <div class="datagrid-view2" style="width: 1238px;">
                    <div class="datagrid-header" style="width: 1238px; height: 24px;">
                        <div class="datagrid-header-inner" style="display: block;">
                            <table class="datagrid-htable" border="0" cellspacing="0" cellpadding="0"
                                style="height: 25px;">
                                <tbody>
                                    <tr class="datagrid-header-row">
                                        <td field="id">
                                            <div class="datagrid-header-check"><input type="checkbox"></div>
                                        </td>
                                        <td field="deptNames">
                                            <div class="datagrid-cell" style="width: 242px;"><span>姓名</span><span
                                                    class="datagrid-sort-icon">&nbsp;</span></div>
                                        </td>
                                        <td field="dicNames">
                                            <div class="datagrid-cell" style="width: 179px;"><span>性别</span><span
                                                    class="datagrid-sort-icon">&nbsp;</span></div>
                                        </td>
                                        <td field="reasons">
                                            <div class="datagrid-cell" style="width: 444px;"><span>工作单位</span><span
                                                    class="datagrid-sort-icon">&nbsp;</span></div>
                                        </td>
                                        <td field="reasons">
                                            <div class="datagrid-cell" style="width: 444px;"><span>职务</span><span
                                                    class="datagrid-sort-icon">&nbsp;</span></div>
                                        </td>
                                    </tr>
                                </tbody>
                            </table>
                        </div>
                    </div>
                    <div class="datagrid-body" style="width: 1238px; height: 0px;">
                        <table class="datagrid-btable" cellspacing="0" cellpadding="0" border="0">
                            <tbody></tbody>
                        </table>
                    </div>
                    <div class="datagrid-footer" style="width: 1238px;">
                        <div class="datagrid-footer-inner" style="display: none;"></div>
                    </div>
                </div>
                <table id="list_data" style="display: none;"></table>
            </div>
            <div class="datagrid-pager pagination">
                <table cellspacing="0" cellpadding="0" border="0">
                    <tbody>
                        <tr>
                            <td><select class="pagination-page-list">
                                    <option>10</option>
                                    <option>20</option>
                                    <option>30</option>
                                    <option>40</option>
                                    <option>50</option>
                                </select></td>
                            <td>
                                <div class="pagination-btn-separator"></div>
                            </td>
                            <td><a href="javascript:void(0)" class="l-btn l-btn-plain l-btn-disabled" id=""><span
                                        class="l-btn-left"><span class="l-btn-text"><span
                                                class="l-btn-empty pagination-first">&nbsp;</span></span></span></a>
                            </td>
                            <td><a href="javascript:void(0)" class="l-btn l-btn-plain l-btn-disabled" id=""><span
                                        class="l-btn-left"><span class="l-btn-text"><span
                                                class="l-btn-empty pagination-prev">&nbsp;</span></span></span></a></td>
                            <td>
                                <div class="pagination-btn-separator"></div>
                            </td>
                            <td><span style="padding-left:6px;">第</span></td>
                            <td><input class="pagination-num" type="text" value="1" size="2"></td>
                            <td><span style="padding-right:6px;">共1页</span></td>
                            <td>
                                <div class="pagination-btn-separator"></div>
                            </td>
                            <td><a href="javascript:void(0)" class="l-btn l-btn-plain l-btn-disabled" id=""><span
                                        class="l-btn-left"><span class="l-btn-text"><span
                                                class="l-btn-empty pagination-next">&nbsp;</span></span></span></a></td>
                            <td><a href="javascript:void(0)" class="l-btn l-btn-plain l-btn-disabled" id=""><span
                                        class="l-btn-left"><span class="l-btn-text"><span
                                                class="l-btn-empty pagination-last">&nbsp;</span></span></span></a></td>
                            <td>
                                <div class="pagination-btn-separator"></div>
                            </td>
                            <td><a href="javascript:void(0)" class="l-btn l-btn-plain" id=""><span
                                        class="l-btn-left"><span class="l-btn-text"><span
                                                class="l-btn-empty pagination-load">&nbsp;</span></span></span></a></td>
                        </tr>
                    </tbody>
                </table>
                <div class="pagination-info">显示0到0,共0记录</div>
                <div style="clear:both;"></div>
            </div>
        </div>
    </div>
    <br>


    <script>
        initSelect(1);//初始化选人框；1：默认根据部门

        $("#applyUserName").click(function () {
            showSelect('applyUserName,applyUserId', 'text,id', '');
        });


        //$("#leaderName").click(function(){
        //   	showSelect('leaderName,leaderId','text,id','');
        //});

        $("#approvalNames").click(function () {
            showSelect('approvalNames,approvalIds', 'text,id', 'checkAny');
        });

        $("#managername").click(function () {
            showSelect('managername,managerid', 'text,id', '');
        });
        $("#managerDname").click(function () {
            showSelect('managerDname,managerDid', 'text,id', '');
        });

        $("#presidentname").click(function () {
            showSelect('presidentname,presidentid', 'text,id', '');
        });

        $("#commisorName").click(function () {
            showSelect('commisorName,commisorId', 'text,id', '');
        });

        function checkFormMe(form) {
            return $('#my-form').form('validate');
        }
        var type = $.getUrlParam("type");
        $("#type").val(type);

        var p_id = $.getUrlParam("id");

        var BaseModel = Backbone.Model.extend({ urlRoot: contextPath + 'manager/exitMission' });
        var baseModel;

        if (p_id == null) {
            baseModel = new BaseModel();
        } else {
            baseModel = new BaseModel({ id: p_id, i: new Date().getTime() });
        }
        var baseView = new BaseView({ el: $("#my-form"), model: baseModel });
        if (p_id != null) {
            baseView.doLoad(loadMe);
        }

        function loadMe(model, response, options) {

        }

        function success(model, response, options) {
            var data = model.get("handleMsg");
            $.messager.alert('提示', model.get("handleMsg").message, 'info', function (rt) {
                if (data.status == 1) {
                    //图层解锁
                    //$("#myForm").unblock();
                    var subtitle = encodeURI(encodeURI($.getUrlParam("subtitle")));
                    window.parent.frames["" + $.getUrlParam("_pfrid")].location.reload();
                    window.location.href = contextPath + "system/qdzxapproval/approval/exitmission_edit.html?type=" + type + "&processid=" + model.get("id") + "&_pfrid=" + $.getUrlParam("_pfrid") + "&_frid=" + $.getUrlParam("_frid") + "&subtitle=" + subtitle;
                } else {
                    $("#errorMsg").html(data.message);
                    //图层解锁
                    //$("#myForm").unblock();
                }
            });
        }

        $('#list_data').datagrid({
            url: contextPath + "manager/exitMissionPersons?i=" + new Date().getTime(),
            fitColumns: true,
            singleSelect: false,
            rownumbers: true,
            pagination: true,
            sortName: 'id',
            sortOrder: 'desc',
            method: 'POST',
            onRowContextMenu: onRowContextMenu,//右键菜单
            queryParams: { "bid": 0 },
            columns: [[
                { field: 'id', checkbox: true },
                { field: 'deptNames', title: '姓名', width: 200 },
                { field: 'dicNames', title: '性别', width: 150 },
                { field: 'reasons', title: '工作单位', width: 300 },
                { field: 'reasons', title: '职务', width: 300 }
            ]]
        });





    </script>
    <div class="panel window" style="display: none; width: 450px; left: 425.5px; top: 25px;">
        <div class="panel-header panel-header-noborder window-header" style="width: 450px;">
            <div class="panel-title panel-with-icon">根据部门选择</div>
            <div class="panel-icon icon-manager"></div>
            <div class="panel-tool"><a class="panel-tool-collapse" href="javascript:void(0)"></a><a
                    class="panel-tool-close" href="javascript:void(0)"></a></div>
        </div>
        <div id="selectMan" class="easyui-window panel-body panel-body-noborder window-body" title=""
            data-options="closed:true,modal:true,iconCls:'icon-manager',minimizable:false,maximizable:false"
            style="z-index: 301; width: 450px; height: 325px;">
            <div id="selectManHead" class="datagrid-toolbar"><a class="easyui-linkbutton l-btn l-btn-plain"
                    iconcls="icon-ok" plain="true" onclick="checkSelectMan();" id=""><span class="l-btn-left"><span
                            class="l-btn-text icon-ok l-btn-icon-left">选择</span></span></a><a
                    class="easyui-linkbutton l-btn l-btn-plain" iconcls="icon-reload" plain="true"
                    onclick="reload_data();" id=""><span class="l-btn-left"><span
                            class="l-btn-text icon-reload l-btn-icon-left">刷新</span></span></a><a
                    class="easyui-linkbutton l-btn l-btn-plain" iconcls="icon-close" plain="true"
                    onclick="closeSelectMan();" id=""><span class="l-btn-left"><span
                            class="l-btn-text icon-close l-btn-icon-left">关闭</span></span></a></div>
            <div id="menu_tree" class="easyui-tree tree tree-lines" style="margin-top:35px;z-index: 300;"
                data-options="animate:true,lines:true,checkbox:true"></div>
        </div>
    </div>
    <div class="window-shadow" style="display: none; left: 425.5px; top: 25px;"></div>
    <div class="window-mask" style="width: 1301px; height: 696px; display: none;"></div>
    <div id="loading1"
        style="position: absolute; left: 0px; top: 0px; width: 100%; height: 696px; background: rgb(232, 232, 232); opacity: 0.5; z-index: 10000; display: none;">
    </div>
    <div id="loading2" class="panel-loading"
        style="position: fixed; top: 38%; left: 41%; border: 2px solid rgb(149, 184, 231); width: 160px; font-size: 14px; z-index: 10001; background: url(&quot;/system/jquery/themes/themes1/images/loading-1.gif&quot;) 10px 8px no-repeat rgb(255, 255, 255); display: none;">
        正在处理，请稍等...</div>
</body>